# Contributor: Ivan Tham <pickfire@riseup.net>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=libwacom
pkgver=2.3.0
pkgrel=0
pkgdesc="Library to help implement Wacom tablet settings"
url="https://github.com/linuxwacom/libwacom/wiki"
arch="all"
license="MIT"
depends="eudev"
makedepends="glib-dev libgudev-dev meson py3-libevdev py3-udev py3-pytest"
checkdepends="bash findutils diffutils libxml2-dev"
subpackages="$pkgname-dev $pkgname-doc"
install="$pkgname.post-install $pkgname.post-upgrade"
source="https://github.com/linuxwacom/libwacom/archive/libwacom-$pkgver/libwacom-$pkgver.tar.gz
	0001-udevadm.patch
	"
builddir="$srcdir/libwacom-libwacom-$pkgver"

build() {
	abuild-meson \
		-Dtests="$(options_has !check && echo disabled || echo enabled)" \
		-Dudev-dir="/lib/udev" \
		. output
	meson compile ${JOBS:+-j ${JOBS}} -C output
}

check() {
	meson test --no-rebuild -v -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="
cd8582c026dd4b0ca7b910e63eae5098501ec03a53f4833e63e0788a8fd04c1bf24ceb0a265fa5f39a569b3e316ec86da77648a96fa40b98a5d7e284fd5206b9  libwacom-2.3.0.tar.gz
50cf7a2bf288f6d27148e264f36df1463b9e22186a8c227803c644bfe4393bb0b8e6b5e922083116b269e88b0974de353905ab93f1727474c3404d83412482da  0001-udevadm.patch
"
